﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using BaseDatos;

namespace SCHD
{
    public partial class WFConsultaProd : TDV.Controles.Base.WinForm.BaseForm_Tipo01
    {
        public WFConsultaProd()
        {
            InitializeComponent();
        }

        private void WFConsultaProd_Load(object sender, EventArgs e)
        {

        }

        private void BtnConsultar_Click(object sender, EventArgs e)
        {
            try
            {
                GrdDatos.DataSource = null;
                string sql = Txtconsulta.Text;
                DataSet ds = ConexionBaseDatos.Conexion.CrearDataSet(sql, CommandType.Text);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    GrdDatos.DataSource = ds.Tables[0];
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            
        }

        private void BtnModificar_Click(object sender, EventArgs e)
        {
            try
            {
              //  GrdDatos.DataSource = null;
                string sql = Txtconsulta.Text;
               ConexionBaseDatos.Conexion.EjecutarComando(sql, CommandType.Text);
                //if (ds.Tables[0].Rows.Count > 0)
                //{
                //    GrdDatos.DataSource = ds.Tables[0];
                //}
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}
